﻿using Medianamik.Client.Data;
using Medianamik.Client.Data.Repositories;
using Medianamik.Core;
using Medianamik.Core.DAL.Repositories;
using Medianamik.Core.Profile;
using Medianamik.Core.Redirect;
using Medianamik.Core.Urls;
using Medianamik.DummyWebSite.Data.Repositories;
using Medianamik.UI.Web.Approbation.Data;
using UserProfile = Medianamik.DummyWebSite.Data.UserProfile;

namespace Medianamik.DummyWebSite.Container.Registries
{
    public class RepositoriesRegistry : StructureMap.Configuration.DSL.Registry
    {
        public RepositoriesRegistry()
         {
             ForRequestedType<IUserProfileRepository<UserProfile>>()
                 .TheDefaultIsConcreteType<UserProfileRepository>();

             ForRequestedType<IMedianamikRepository<IMedianamikDTOWithName>>()
                .TheDefaultIsConcreteType<MedianamikDTOWithNameRepository>();

            ForRequestedType<IMedianamikRepository<BaseType>>()
                .TheDefaultIsConcreteType<BaseTypeRepository>();

             ForRequestedType<IBaseTypeRepository>()
                 .TheDefaultIsConcreteType<BaseTypeRepository>();

             ForRequestedType<INodeRepository>()
                 .TheDefaultIsConcreteType<NodeRepository>();
             
             ForRequestedType<INodeTypeRepository>()
                 .TheDefaultIsConcreteType<NodeTypeRepository>();

             ForRequestedType<IApprobationRepository<ApprobationDTO>>()
                 .TheDefaultIsConcreteType<ApprobationRepository>();

             ForRequestedType<IUserProfileResolver>()
                .TheDefaultIsConcreteType<UserProfileResover>();

             ForRequestedType<IUrlRepository>()
                 .TheDefaultIsConcreteType<UrlRepository>();

             ForRequestedType<IExternalRedirectUrlRepository>()
                  .TheDefaultIsConcreteType<ExternalRedirectRepository>();

             ForRequestedType<IRedirectUrlRepository>()
                   .TheDefaultIsConcreteType<RedirectRepository>();

             ForRequestedType<IMedianamikRepository<BaseWebType>>()
                 .TheDefaultIsConcreteType<BaseWebTypeRepository>();

             ForRequestedType<IMedianamikRepository<Client.Data.MedianamikModule>>()
                 .TheDefaultIsConcreteType<ModuleRepository>();

            ForRequestedType<IMedianamikModuleRepository>()
                .TheDefaultIsConcreteType<ModuleRepository>();
         }
    }
}
